package com.web.util;

import java.util.List;
import java.util.Vector;

import wfm.bean.User;

public class RegisteredUsers {
	private static List<User> regUsers=new Vector<User>();
	
	
	static{	
		regUsers.add(new User("b.mueller@realestate.com","beate","Beate","Müller",User.GROUP_DESKTOPWORKER));
		regUsers.add(new User("e.bauminger@realestate.com","erich","Erich","Bauminger",User.GROUP_SUPERVISOR));
		regUsers.add(new User("g.herzinger@realestate.com","gustav","Gustav","Herzinger",User.GROUP_SURVEYOR));
	}
	
	
	static public boolean isRegistered(String username,String password){
		for(User u : regUsers){
			if(u.getUserName().equals(username) && u.getPassword().equals(password))
				return true;
		}
		
		return false;
	}
	
	static public User getUser(String username,String password){
		for(User u : regUsers){
			if(u.getUserName().equals(username) && u.getPassword().equals(password))
				return u;
		}
		
		return null;
	}
	
	
}
